import ApiService from '../axios';
import type { 
    SeachData, 
    TableRes, 
    SearchMarkData, 
    MarkRes, 
    AddMarkParams, 
    UpdateMarkParams, 
    MarkListRes, 
    AddUserParams,
    UpdateUserParams
} from './userManage.d';

export function getTableData(params: SeachData) {
    const data = ApiService.post<TableRes>('/user/search', params);
    return data
}

export function getMarkData(data: SearchMarkData) {
    return ApiService.post('/company/list', data);
}

export async function addMark(params: AddMarkParams) {
    const data = await ApiService.post<MarkListRes>('/company', params);
    return data;
}

export function updateMarkStatus(data: UpdateMarkParams) {
    return ApiService.put<MarkListRes>('/company', data);
}

export async function addUser(params: AddUserParams) {
    const data = await ApiService.post<MarkListRes>('/user', params);
    return data;
}

export function updateUser(data: UpdateUserParams) {
    return ApiService.put<MarkListRes>('/user', data);
}